package com.devg.file.web.index.controller;

import com.devg.file.web.utils.CommonUtil;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@RequestMapping("/")
@Controller
public class IndexController {

  @RequestMapping("")
  public ModelAndView index() {
    Map<String, Object> result = new HashMap<>();
    return new ModelAndView("index", result);
  }

  @RequestMapping(value = {"/web/page"})
  public ModelAndView page(@RequestParam Map<String, Object> param) {
    String path = CommonUtil.getMapString(param, "path");
    return new ModelAndView(path, param);
  }

}
